import request from '@/utils/request'

/** **
 * 获取所有权限点
 *  /sys/permission  GET
 * ****/
export function getPermList() {
  return request({
    url: `/sys/permission`
  })
}

/** **
 * 根据id删除权限点
 *   /sys/permission/{id}   DELETE
 * ****/
export function delPerm(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

/** **
 * 根据id获取权限点详情
 *   /sys/permission/{id}   get
 * ****/
export function getPermDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}

/** **
 * 根据ID更新权限点详情
 *   /sys/permission/{id}   PUT
 * ****/
export function editPermDetail(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

/** **
 * 添加权限点
 *    /sys/permission   POST
 * ****/
export function addPerm(data) {
  return request({
    url: `/sys/permission`,
    method: 'post',
    data
  })
}

